package com.sunwayhorizo.health.hl7.persistent;

import java.io.Serializable;

import java.sql.Timestamp;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@NamedQuery(name = "RimCoreRootMaster.findAll", query = "select o from RimCoreRootMaster o")
@Table(name = "RIM_CORE_ROOT_MASTER")
public class RimCoreRootMaster implements Serializable {    
    @Id 
    @Column(name = "ROOT_ID", nullable = false)    private String rootId;    
    @Column(name = "ROOT_NAME")    private String rootName;
    @Column(name = "NEXT_AVAILABLE_EXTENSION")    private String nextAvailableExtension;
    @Column(name = "INTERNAL_ROOT_FLAG")    private String internalRootFlag;
    
    @Column(name = "CREATED_BY", nullable = false)    private Long createdBy;
    @Column(name = "CREATION_DATE", nullable = false)    private Timestamp creationDate;    
    @Column(name = "LAST_UPDATED_BY", nullable = false)    private Long lastUpdatedBy;
    @Column(name = "LAST_UPDATE_DATE", nullable = false)    private Timestamp lastUpdateDate;
    @Column(name = "LAST_UPDATE_LOGIN")    private Long lastUpdateLogin;    
    
//    @OneToMany(mappedBy = "rimCoreRootMaster")    private List<RimCoreRoleIi> rimCoreRoleIiList;
//    @OneToMany(mappedBy = "rimCoreRootMaster")    private List<RimCoreEntyIi> rimCoreEntyIiList;
//    @OneToMany(mappedBy = "rimCoreRootMaster")    private List<RimCoreActIi> rimCoreActIiList;

    @OneToMany(mappedBy = "rootMaster")    private List<RimCoreActs> actsList;

    public RimCoreRootMaster() {
    }

    public Long getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Long createdBy) {
        this.createdBy = createdBy;
    }

    public Timestamp getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Timestamp creationDate) {
        this.creationDate = creationDate;
    }

    public String getInternalRootFlag() {
        return internalRootFlag;
    }

    public void setInternalRootFlag(String internalRootFlag) {
        this.internalRootFlag = internalRootFlag;
    }

    public Long getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(Long lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Timestamp getLastUpdateDate() {
        return lastUpdateDate;
    }

    public void setLastUpdateDate(Timestamp lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }

    public Long getLastUpdateLogin() {
        return lastUpdateLogin;
    }

    public void setLastUpdateLogin(Long lastUpdateLogin) {
        this.lastUpdateLogin = lastUpdateLogin;
    }

    public String getRootId() {
        return rootId;
    }

    public void setRootId(String rootId) {
        this.rootId = rootId;
    }
    

    public void setNextAvailableExtension(String nextAvailableExtension) {
        this.nextAvailableExtension = nextAvailableExtension;
    }

    public String getNextAvailableExtension() {
        return nextAvailableExtension;
    }

    public String getRootName() {
        return rootName;
    }

    public void setRootName(String rootName) {
        this.rootName = rootName;
    }
    
/*    public List<RimCoreRoleIi> getRimCoreRoleIiList() {
        return rimCoreRoleIiList;
    }

    public void setRimCoreRoleIiList(List<RimCoreRoleIi> rimCoreRoleIiList) {
        this.rimCoreRoleIiList = rimCoreRoleIiList;
    }

    public RimCoreRoleIi addRimCoreRoleIi(RimCoreRoleIi rimCoreRoleIi) {
        getRimCoreRoleIiList().add(rimCoreRoleIi);
        rimCoreRoleIi.setRimCoreRootMaster(this);
        return rimCoreRoleIi;
    }

    public RimCoreRoleIi removeRimCoreRoleIi(RimCoreRoleIi rimCoreRoleIi) {
        getRimCoreRoleIiList().remove(rimCoreRoleIi);
        rimCoreRoleIi.setRimCoreRootMaster(null);
        return rimCoreRoleIi;
    }

    public List<RimCoreEntyIi> getRimCoreEntyIiList() {
        return rimCoreEntyIiList;
    }

    public void setRimCoreEntyIiList(List<RimCoreEntyIi> rimCoreEntyIiList) {
        this.rimCoreEntyIiList = rimCoreEntyIiList;
    }

    public RimCoreEntyIi addRimCoreEntyIi(RimCoreEntyIi rimCoreEntyIi) {
        getRimCoreEntyIiList().add(rimCoreEntyIi);
        rimCoreEntyIi.setRimCoreRootMaster(this);
        return rimCoreEntyIi;
    }

    public RimCoreEntyIi removeRimCoreEntyIi(RimCoreEntyIi rimCoreEntyIi) {
        getRimCoreEntyIiList().remove(rimCoreEntyIi);
        rimCoreEntyIi.setRimCoreRootMaster(null);
        return rimCoreEntyIi;
    }

    public List<RimCoreActIi> getRimCoreActIiList() {
        return rimCoreActIiList;
    }

    public void setRimCoreActIiList(List<RimCoreActIi> rimCoreActIiList) {
        this.rimCoreActIiList = rimCoreActIiList;
    }

    public RimCoreActIi addRimCoreActIi(RimCoreActIi rimCoreActIi) {
        getRimCoreActIiList().add(rimCoreActIi);
        rimCoreActIi.setRimCoreRootMaster(this);
        return rimCoreActIi;
    }

    public RimCoreActIi removeRimCoreActIi(RimCoreActIi rimCoreActIi) {
        getRimCoreActIiList().remove(rimCoreActIi);
        rimCoreActIi.setRimCoreRootMaster(null);
        return rimCoreActIi;
    }
*/
    public List<RimCoreActs> getActsList() {
        return actsList;
    }

    public void setActsList(List<RimCoreActs> actsList) {
        this.actsList = actsList;
    }

    public RimCoreActs addActs(RimCoreActs acts) {
        getActsList().add(acts);
        acts.setRootMaster(this);
        return acts;
    }

    public RimCoreActs removeActs(RimCoreActs acts) {
        getActsList().remove(acts);
        acts.setRootMaster(null);
        return acts;
    }

}
